using System;
using System.Collections.Generic;
using System.Text;
using LibGreen.Jabber.ProtocolElements;

namespace LibGreen.Jabber.Dispatchers
{
    /// <summary>
    /// Defines an interface to be implemented by objects that process XMPP elements
    /// </summary>
    public interface IDispatcher
    {
        /// <summary>
        /// Initializes the dispatcher
        /// </summary>
        void Initialize();

        /// <summary>
        /// Dispatches a newly received <see cref="Element"/> for processing
        /// </summary>
        /// <param name="element">The newly received <see cref="Element"/> that must be processed</param>
        /// <returns><c>true</c> if the dispatcher processed the element, <c>false</c> otherwise</returns>
        bool DispatchElement(Element element);
    }
}
